package com.avic.rong.search.JiLuSqlite;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by Chenjiaxin on 2019/8/2 15:54
 * E-Mail Address：16601203965@163.com
 */
public class JiLuHelper extends SQLiteOpenHelper {

    public static final String TABLE_NAME = "jilu";

    private static final String name = "JiLu"; //数据库名称

    private static final int version = 1; //数据库版本

    public JiLuHelper(Context context) {
        super(context, name, null, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table if not exists jilu(id integer primary key autoincrement,text varchar)";
        try {
            db.execSQL(sql);
        } catch (SQLException e) {
            Log.e("cjx", "onCreate" + JiLuHelper.TABLE_NAME + "Error" + e.toString());
            e.printStackTrace();
        }
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
